/*
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.

*/



#include "trackpoint.h"

TrackPoint::TrackPoint()
{
    lat = 0;
    lon = 0;
    elev = 0;
    time = QDateTime::currentDateTime();
}


void TrackPoint::setValues(float la,float lo, float el,QDateTime t)
{
    lat = la;
    lon = lo;
    elev = el;
    time = t;

}
void TrackPoint::setTime(QDateTime t)
{
    time = t;
}

QString TrackPoint::getPoint()
{
    QString temp;

    temp.append("      <trkpt lon=\"" + QString::number(lon,'f',6) +
                "\" lat=\"" + QString::number(lat,'f',6) + "\">" + GPX_NL +
                "        <ele>" + QString::number(elev) + "</ele>" + GPX_NL +
                "        <time>" + time.toString("yyyy-MM-ddThh:mm:ss.zzzZ") + "</time>" + GPX_NL +
                "      </trkpt>" + GPX_NL);



    return temp;
}
